<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>10.5.流程控制-分支结构-switch语句</title>
    <script>
        // 1.语法结构：switch：转换、开关 case 小例子 或者 选项的意思
        /*         switch (表达式) {
                    case value1:
                        执行语句1;
                        break;
                    case value2:
                        执行语句2;
                        break;
                    ...
                    default:
                    执行最后的语句;
                } */
        //2.代码验证
        switch (2) {
            case 1:
                console.log('这是1');
                break;
            case 2:
                console.log('这是2');
                break;
            case 3:
                console.log('这是3');
                break;
            default:
                console.log('没有匹配结果');
        }
    </script>
</head>

<body>

</body>

</html>